package com.sright.bcard.common.service.share.excel.format.number;

import com.sright.bcard.common.service.share.excel.format.DataFormat;

import java.text.DecimalFormat;

/**
 * Created by kangshuangxi on 2017/4/8.
 */
public class LongToStringFormat<T extends Long> implements DataFormat<T> {

    /* 数字格式为字符串 */
    private static final DecimalFormat decimalFormat = new DecimalFormat("#");

    @Override
    public String format(T data) {
        if (data != null)
            return decimalFormat.format(data);

        return null;
    }
}
